#pragma once

#include "Applications/QtBaseApplication.h"
#include "../blobz/include/Graphics/gui/ButtonItem.h"

#include "Utility/Config.h"

#include <QFont>
#include <QFontMetrics>

namespace QtTutorial3
{
	class QtTutorial3App : public Blobz::QtBaseApplication
	{
		Q_OBJECT
	public:
		QtTutorial3App();
		~QtTutorial3App();

	public:
		virtual bool onInitialize();
		virtual void onDeinitialize();

		virtual void onUpdate(float inFrameTime);
		virtual bool onEvent(QEvent *inEvent);

	public:
		virtual void onFingerDown(const TouchListener::TouchData& inData);
		virtual void onFingerUp(const TouchListener::TouchData& inData);
		virtual void onFingerUpdate(const TouchListener::TouchData& inData);
		virtual void onFingerExit(const TouchListener::TouchData& inData);

		virtual void paint(QPainter* inpPainter, const QStyleOptionGraphicsItem *inpOption, QWidget *inpWidget);

	public slots:
		void back();
		void forward();
		void reload();
		void home();
		void showKeyboard();
		
		void onItemsSizeSetup();

	private:
		QImage mBackground; 
		QVector<Blobz::ButtonItem*> mButtons;
		QString mMessage;

		QFont mFont;
		QFontMetrics mFontMetrics;
	};
}